package com.system.controller.web;

import com.common.annotation.LogInfo;
import com.system.dto.DtDictDto;
import com.system.service.DictService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/web/dict")
@Api(value = "客户端字典控制层",tags = {"客户端字典控制层"})
@LogInfo
public class CommentDictController {

    @Autowired
    private DictService dictService;


    @ApiOperation("通用字典获取接口")
    @GetMapping("/getDict/{code}")
    public ResponseEntity getDict(@PathVariable("code")String code){
        return dictService.getDictValueBycode(code);
    }

    @ApiOperation("通用动态字典获取接口")
    @GetMapping("/getDtDict")
    public ResponseEntity getDtDict( DtDictDto dtDictDto){
        return dictService.getDtDict(dtDictDto);
    }


}
